/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Edwin
 */
@Entity
@Table(name = "SOUNDTRACK")
//@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "Soundtrack.findByTitle", query = "SELECT s FROM Song s WHERE s.SongTitle = :SongTitle"),
//    @NamedQuery(name = "Song.findByDuration", query = "SELECT s FROM Song s WHERE s.SongDuration = :SongDuration"),
//    @NamedQuery(name = "Song.findByArtist", query = "SELECT s FROM Song s WHERE s.SongArtist = :SongArtist"),
//    @NamedQuery(name = "Song.findByArtist", query = "SELECT s FROM Song s WHERE s.SongSoundTrack = :SongSoundTrack"),
//})
public class Soundtrack implements Serializable {
    
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="SongID")
    private Long id;
    @Column(name="SongPicture")
    private String picture;
    @JoinColumn(name="SongSoundTrack")
    @OneToMany(mappedBy = "soundtrackEntity")
    private List<Song> songEntitys;
//    @JoinColumn(name="SongMovie")
//    @OneToOne
//    private Movie movieEntity;

    public Soundtrack() {
    }

    public Soundtrack(Long id) {
        this.id=id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public List<Song> getSongEntitys() {
        return songEntitys;
    }

    public void setSongEntitys(List<Song> songEntitys) {
        this.songEntitys = songEntitys;
    }

//    public Movie getMovieEntity() {
//        return movieEntity;
//    }
//
//    public void setMovieEntity(Movie movieEntity) {
//        this.movieEntity = movieEntity;
//    }
//    
    
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Soundtrack)) {
            return false;
        }
        Soundtrack other = (Soundtrack) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entitys.SoundtrackEntity[ id=" + id + " ]";
    }
    
}
